
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>App组件化开发 · Aivin开发笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Aivin">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="sdk开发.html" />
    
    
    <link rel="prev" href="Apk插件化开发.html" />
    

    
        <link rel="shortcut icon" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    首页
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../doc/常用网站.html">
            
                <a href="../doc/常用网站.html">
            
                    
                    常用网站
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../常用软件/常用软件和框架.html">
            
                <a href="../常用软件/常用软件和框架.html">
            
                    
                    常用软件和框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../doc/开发规范.html">
            
                <a href="../doc/开发规范.html">
            
                    
                    开发规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../doc/开源软件.html">
            
                <a href="../doc/开源软件.html">
            
                    
                    开源软件和框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../doc/Android常用代码.html">
            
                <a href="../doc/Android常用代码.html">
            
                    
                    Android常用代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../源码阅读/源码阅读配置.html">
            
                <a href="../源码阅读/源码阅读配置.html">
            
                    
                    源码阅读
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../源码阅读/其他框架源码.html">
            
                <a href="../源码阅读/其他框架源码.html">
            
                    
                    其他框架源码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../产品经理/产品经理.html">
            
                <a href="../产品经理/产品经理.html">
            
                    
                    产品经理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../设计模式/设计模式.html">
            
                <a href="../设计模式/设计模式.html">
            
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../设计模式/设计模式.html">
            
                <a href="../设计模式/设计模式.html">
            
                    
                    设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../设计模式/模式详解.html">
            
                <a href="../设计模式/模式详解.html">
            
                    
                    模式详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../设计模式/mvc等.html">
            
                <a href="../设计模式/mvc等.html">
            
                    
                    mvc等
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../数据结构/常用数据结构.html">
            
                <a href="../数据结构/常用数据结构.html">
            
                    
                    基本算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../数据结构/常用数据结构.html">
            
                <a href="../数据结构/常用数据结构.html">
            
                    
                    常用数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../常用算法/算法术语.html">
            
                <a href="../常用算法/算法术语.html">
            
                    
                    算法术语
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../常用算法/排序算法.html">
            
                <a href="../常用算法/排序算法.html">
            
                    
                    排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../常用算法/查找算法.html">
            
                <a href="../常用算法/查找算法.html">
            
                    
                    查找算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../常用算法/大数相加.html">
            
                <a href="../常用算法/大数相加.html">
            
                    
                    大数相加
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../常用算法/集合的所有子集.html">
            
                <a href="../常用算法/集合的所有子集.html">
            
                    
                    获得集合的所有子集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../常用算法/扫描线种子填充算法.html">
            
                <a href="../常用算法/扫描线种子填充算法.html">
            
                    
                    扫描线种子填充算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.8" data-path="../常用算法/其他算法.html">
            
                <a href="../常用算法/其他算法.html">
            
                    
                    其他算法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../java基础/原码补码反码.html">
            
                <a href="../java基础/原码补码反码.html">
            
                    
                    Java部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../java基础/原码补码反码.html">
            
                <a href="../java基础/原码补码反码.html">
            
                    
                    原码补码反码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../java基础/java常用代码.html">
            
                <a href="../java基础/java常用代码.html">
            
                    
                    java常用代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../java基础/JVM详解.html">
            
                <a href="../java基础/JVM详解.html">
            
                    
                    JVM详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../java基础/类加载机制.html">
            
                <a href="../java基础/类加载机制.html">
            
                    
                    类加载机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../java基础/内存模型.html">
            
                <a href="../java基础/内存模型.html">
            
                    
                    内存模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../java基础/GC机制.html">
            
                <a href="../java基础/GC机制.html">
            
                    
                    GC机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../java基础/对象内存布局.html">
            
                <a href="../java基础/对象内存布局.html">
            
                    
                    对象内存布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../java基础/继承多态.html">
            
                <a href="../java基础/继承多态.html">
            
                    
                    继承和多态
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../java基础/相等判断.html">
            
                <a href="../java基础/相等判断.html">
            
                    
                    相等判断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../java基础/Java容器类.html">
            
                <a href="../java基础/Java容器类.html">
            
                    
                    Java容器类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../java基础/Java枚举.html">
            
                <a href="../java基础/Java枚举.html">
            
                    
                    Java枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../java基础/自定义异常.html">
            
                <a href="../java基础/自定义异常.html">
            
                    
                    自定义异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../java基础/深度拷贝.html">
            
                <a href="../java基础/深度拷贝.html">
            
                    
                    深度拷贝
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../java基础/泛型详解.html">
            
                <a href="../java基础/泛型详解.html">
            
                    
                    泛型详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../java基础/线程详解.html">
            
                <a href="../java基础/线程详解.html">
            
                    
                    线程详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../java基础/java注解.html">
            
                <a href="../java基础/java注解.html">
            
                    
                    注解详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../java基础/数据解析.html">
            
                <a href="../java基础/数据解析.html">
            
                    
                    数据解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../java基础/java8新特性.html">
            
                <a href="../java基础/java8新特性.html">
            
                    
                    Java8新特性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="android零散知识.html">
            
                <a href="android零散知识.html">
            
                    
                    Android部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="基础控件使用.html">
            
                <a href="基础控件使用.html">
            
                    
                    基础控件使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="android零散知识.html">
            
                <a href="android零散知识.html">
            
                    
                    Android零散知识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="android坐标体系.html">
            
                <a href="android坐标体系.html">
            
                    
                    Android坐标体系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="APP的启动流程.html">
            
                <a href="APP的启动流程.html">
            
                    
                    APP启动流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.5" data-path="View加载流程.html">
            
                <a href="View加载流程.html">
            
                    
                    View加载流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.6" data-path="事件分发机制.html">
            
                <a href="事件分发机制.html">
            
                    
                    事件分发机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.7" data-path="控件绘制流程.html">
            
                <a href="控件绘制流程.html">
            
                    
                    控件绘制流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.8" data-path="常用shape.html">
            
                <a href="常用shape.html">
            
                    
                    常用shape
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.9" data-path="进程通信.html">
            
                <a href="进程通信.html">
            
                    
                    进程通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.10" data-path="../通信方式/通信方式详解.html">
            
                <a href="../通信方式/通信方式详解.html">
            
                    
                    通信方式详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.11" data-path="Binder详解.html">
            
                <a href="Binder详解.html">
            
                    
                    Binder详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.12" data-path="Handler详解.html">
            
                <a href="Handler详解.html">
            
                    
                    Handle详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.13" data-path="Fragment详解.html">
            
                <a href="Fragment详解.html">
            
                    
                    Fragment详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.14" data-path="Activity详解.html">
            
                <a href="Activity详解.html">
            
                    
                    Activity详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.15" data-path="BroadcastReceiver.html">
            
                <a href="BroadcastReceiver.html">
            
                    
                    BroadcastReceiver详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.16" data-path="Service服务.html">
            
                <a href="Service服务.html">
            
                    
                    Service详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.17" data-path="动画详解.html">
            
                <a href="动画详解.html">
            
                    
                    动画详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.18" data-path="屏幕刷新机制.html">
            
                <a href="屏幕刷新机制.html">
            
                    
                    屏幕刷新机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.19" data-path="屏幕适配.html">
            
                <a href="屏幕适配.html">
            
                    
                    屏幕适配
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.20" data-path="图片加载详解.html">
            
                <a href="图片加载详解.html">
            
                    
                    图片加载详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.21" data-path="WebView详解.html">
            
                <a href="WebView详解.html">
            
                    
                    WebView详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.22" data-path="沉浸式.html">
            
                <a href="沉浸式.html">
            
                    
                    沉浸式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.23" data-path="相机模块.html">
            
                <a href="相机模块.html">
            
                    
                    相机模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.24" data-path="地图模块.html">
            
                <a href="地图模块.html">
            
                    
                    地图模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.25" data-path="Androidstudio插件开发.html">
            
                <a href="Androidstudio插件开发.html">
            
                    
                    Androidstudio插件开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.26" data-path="Apk插件化开发.html">
            
                <a href="Apk插件化开发.html">
            
                    
                    Apk插件化开发
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.12.27" data-path="App组件化开发.html">
            
                <a href="App组件化开发.html">
            
                    
                    App组件化开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.28" data-path="sdk开发.html">
            
                <a href="sdk开发.html">
            
                    
                    sdk开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.29" data-path="APP优化.html">
            
                <a href="APP优化.html">
            
                    
                    APP优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.30" data-path="项目参数配置.html">
            
                <a href="项目参数配置.html">
            
                    
                    项目参数配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.31" data-path="App发布.html">
            
                <a href="App发布.html">
            
                    
                    App发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.32" data-path="Android外挂.html">
            
                <a href="Android外挂.html">
            
                    
                    Android外挂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.33" data-path="Android字节码插桩.html">
            
                <a href="Android字节码插桩.html">
            
                    
                    Android字节码插桩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.34" data-path="智能家居.html">
            
                <a href="智能家居.html">
            
                    
                    智能家居
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../python/python基础.html">
            
                <a href="../python/python基础.html">
            
                    
                    python部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../python/python基础.html">
            
                <a href="../python/python基础.html">
            
                    
                    python基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../python/python爬虫.html">
            
                <a href="../python/python爬虫.html">
            
                    
                    python爬虫
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../gradle/Groovy.html">
            
                <a href="../gradle/Groovy.html">
            
                    
                    Groovy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../kotlin/kotlin部分.html">
            
                <a href="../kotlin/kotlin部分.html">
            
                    
                    kotlin部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../flutter/flutter部分.html">
            
                <a href="../flutter/flutter部分.html">
            
                    
                    flutter部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../native/ccpp.html">
            
                <a href="../native/ccpp.html">
            
                    
                    native部分
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../native/Linux.html">
            
                <a href="../native/Linux.html">
            
                    
                    Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../native/ccpp.html">
            
                <a href="../native/ccpp.html">
            
                    
                    cCpp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../native/NDK.html">
            
                <a href="../native/NDK.html">
            
                    
                    NDK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../native/系统编译剪裁.html">
            
                <a href="../native/系统编译剪裁.html">
            
                    
                    系统编译剪裁
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.5" data-path="../native/音视频.html">
            
                <a href="../native/音视频.html">
            
                    
                    音视频
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.6" data-path="../native/音视频第三方库.html">
            
                <a href="../native/音视频第三方库.html">
            
                    
                    音视频第三方库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.7" data-path="../native/相关代码.html">
            
                <a href="../native/相关代码.html">
            
                    
                    相关代码
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../server/服务器部分.html">
            
                <a href="../server/服务器部分.html">
            
                    
                    服务器部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="../webDev/web部分.html">
            
                <a href="../webDev/web部分.html">
            
                    
                    web部分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="../人工智能/人工智能相关概念.html">
            
                <a href="../人工智能/人工智能相关概念.html">
            
                    
                    人工智能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="../面试真题/极飞.html">
            
                <a href="../面试真题/极飞.html">
            
                    
                    面试真题
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >App组件化开发</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#app&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;"><b>1. </b>App&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;</a></li><ul><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;"><b>1.1. </b>&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;"><b>1.2. </b>&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><b>1.3. </b>&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5; (&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F; - &#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;)</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><b>1.4. </b>&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5; (&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F; - &#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;)</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C;-&#x3001;&#x901A;&#x4FE1;-&#x6846;&#x67B6;"><b>1.5. </b>&#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C; &#x3001;&#x901A;&#x4FE1; &#x6846;&#x67B6;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x57FA;&#x672C;&#x4F7F;&#x7528;"><b>1.6. </b>ARouter &#x57FA;&#x672C;&#x4F7F;&#x7528;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x8DEF;&#x7531;&#x539F;&#x7406;"><b>1.7. </b>ARouter &#x8DEF;&#x7531;&#x539F;&#x7406;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;app&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;--&#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1;-iprovider-"><b>1.8. </b>ARouter &#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;APP&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1; ( &#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1; IProvider )</a></li><li><span class="title-icon "></span><a href="#arouter-&#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;"><b>1.9. </b>ARouter &#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x9875;&#x9762;&#x62E6;&#x622A;"><b>1.10. </b>ARouter &#x9875;&#x9762;&#x62E6;&#x622A;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x964D;&#x7EA7;&#x7B56;&#x7565;"><b>1.11. </b>ARouter &#x964D;&#x7EA7;&#x7B56;&#x7565;</a></li><li><span class="title-icon "></span><a href="#arouter-&#x91CD;&#x5199;&#x8DF3;&#x8F6C;url-&#x3001;&#x91CD;&#x5B9A;&#x5411;"><b>1.12. </b>ARouter &#x91CD;&#x5199;&#x8DF3;&#x8F6C;URL &#x3001;&#x91CD;&#x5B9A;&#x5411;</a></li></ul></ul></div><a href="#app&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="app&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;"><a name="app&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;" class="anchor-navigation-ex-anchor" href="#app&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;"><i class="fa fa-link" aria-hidden="true"></i></a>1. App&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;</h1>
<h2 id="&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;"><a name="&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. &#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x89E3;&#x51B3;&#x7684;&#x75DB;&#x70B9;</h2>
<pre><code class="lang-text">1&#x3001;&#x9879;&#x76EE;&#x6A21;&#x5757;&#x591A;&#x4E14;&#x590D;&#x6742;&#xFF0C;&#x7F16;&#x8BD1;&#x4E00;&#x6B21;&#x8981;5&#x5206;&#x949F;&#x751A;&#x81F3;10&#x5206;&#x949F;&#xFF1F;&#x592A;&#x6162;&#x4E0D;&#x80FD;&#x5FCD;&#xFF1F;
2&#x3001;&#x6539;&#x4E86;&#x4E00;&#x884C;&#x4EE3;&#x7801; &#x6216;&#x53EA;&#x8C03;&#x4E86;&#x4E00;&#x70B9;UI&#xFF0C;&#x5C31;&#x8981;run&#x6574;&#x4E2A;&#x9879;&#x76EE;&#xFF0C;&#x518D;&#x5FCD;&#x53D7;&#x4E00;&#x6B21;10&#x5206;&#x949F;&#xFF1F;
3&#x3001;&#x5408;&#x4EE3;&#x7801;&#x7ECF;&#x5E38;&#x53D1;&#x751F;&#x51B2;&#x7A81;&#xFF1F;&#x5F88;&#x70E6;&#xFF1F;
4&#x3001;&#x88AB;&#x4EBA;&#x5077;&#x5077;&#x6539;&#x4E86;&#x81EA;&#x5DF1;&#x6A21;&#x5757;&#x7684;&#x4EE3;&#x7801;&#xFF1F;&#x5F88;&#x4E0D;&#x723D;&#xFF1F;
5&#x3001;&#x505A;&#x4E00;&#x4E2A;&#x9700;&#x6C42;&#xFF0C;&#x53D1;&#x73B0;&#x8FD8;&#x8981;&#x53BB;&#x6539;&#x52A8;&#x5F88;&#x591A;&#x522B;&#x4EBA;&#x6A21;&#x5757;&#x7684;&#x4EE3;&#x7801;&#xFF1F;
6&#x3001;&#x522B;&#x7684;&#x6A21;&#x5757;&#x5DF2;&#x5B9E;&#x73B0;&#x7684;&#x7C7B;&#x4F3C;&#x529F;&#x80FD;&#xFF0C;&#x81EA;&#x5DF1;&#x8981;&#x7528;&#x53EA;&#x80FD;&#x53BB;&#x590D;&#x5236;&#x4E00;&#x4EFD;&#x4EE3;&#x7801;&#x518D;&#x6539;&#x6539;&#xFF1F;
7&#x3001;&#x201C;&#x8FD9;&#x4E2A;&#x4E0D;&#x662F;&#x6211;&#x8D1F;&#x8D23;&#x7684;&#xFF0C;&#x6211;&#x4E0D;&#x7BA1;&#x201D;&#xFF0C;&#x4EE3;&#x7801;&#x8D23;&#x4EFB;&#x8303;&#x56F4;&#x4E0D;&#x660E;&#x786E;&#xFF1F;
8&#x3001;&#x53EA;&#x505A;&#x4E86;&#x4E00;&#x4E2A;&#x6A21;&#x5757;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x4F46;&#x6539;&#x52A8;&#x70B9;&#x5F88;&#x591A;&#xFF0C;&#x6240;&#x4EE5;&#x8981;&#x5B8C;&#x6574;&#x56DE;&#x5F52;&#x6D4B;&#x8BD5;&#xFF1F;
9&#x3001;&#x505A;&#x4E86;&#x4E2A;&#x9700;&#x6C42;&#xFF0C;&#x4F46;&#x4E0D;&#x77E5;&#x4E0D;&#x89C9;&#x5BFC;&#x81F4;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#x51FA;&#x73B0;bug&#xFF1F;
</code></pre>
<h2 id="&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;"><a name="&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2. &#x7EC4;&#x4EF6;&#x5316;&#x5F00;&#x53D1;&#x7684;&#x5173;&#x952E;&#x7279;&#x5F81;</h2>
<pre><code class="lang-text">&#x7EC4;&#x4EF6;&#x5316;&#x7684;&#x6838;&#x5FC3;&#x5C31;&#x662F;&#x89E3;&#x8026;&#xFF0C;
&#x6BCF;&#x4E2A;&#x4E1A;&#x52A1;&#x7EC4;&#x4EF6;&#x662F;&#x4E92;&#x76F8;&#x72EC;&#x7ACB;&#x7684;&#xFF0C;&#x4E0D;&#x5B58;&#x5728;&#x76F4;&#x63A5;&#x7684;&#x4F9D;&#x8D56;&#x5173;&#x7CFB;&#x3002;
&#x6BD4;&#x5982;&#x767B;&#x5F55;&#x7EC4;&#x4EF6;&#x3001;&#x652F;&#x4ED8;&#x7EC4;&#x4EF6;&#x662F;&#x4E92;&#x4E0D;&#x5F71;&#x54CD;&#x7684;&#x3002;
</code></pre>
<h2 id="&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><a name="&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3. &#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5; (&#x5355;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F; - &#x5355;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;)</h2>
<pre><code class="lang-text">// &#x8F93;&#x51FA; apk (&#x8C03;&#x8BD5;&#x9636;&#x6BB5;&#x914D;&#x7F6E;)
com.android.application
// &#x8F93;&#x51FA; aar (&#x96C6;&#x6210;&#x9636;&#x6BB5;&#x914D;&#x7F6E;)
com.android.library

// &#x6279;&#x91CF;&#x81EA;&#x52A8;&#x5207;&#x6362;
1&#x3001;&#x5728;&#x6839;  build.gradle &#x4E2D;&#x505A;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;
ext {
    isLibrary  = true
}

2&#x3001;&#x5728;&#x7EC4;&#x4EF6; build.gradle &#x4E2D;&#x914D;&#x7F6E;
def isLibrary =  rootProject.isLibrary
if (isLibrary.toBoolean()){
    apply plugin: &apos;com.android.library&apos;
}else {
    apply plugin: &apos;com.android.application&apos;
}

defaultConfig {
    if(!isLibrary.toBoolean()){
        applicationId &quot;com.wkreader.base&quot;
    }
}
sourceSets {
    main {
        if (isLibrary.toBoolean()) {
            manifest.srcFile &apos;src/main/AndroidManifestlib.xml&apos;
        } else {
            manifest.srcFile &apos;src/main/AndroidManifest.xml&apos;
        }
    }
}
</code></pre>
<h2 id="&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><a name="&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5;-&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;---&#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;"><i class="fa fa-link" aria-hidden="true"></i></a>1.4. &#x7EC4;&#x4EF6;&#x72EC;&#x7ACB;&#x8C03;&#x8BD5; (&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F; - &#x591A;&#x4EBA;&#x5F00;&#x53D1;&#xFF0C;&#x63A8;&#x8350;)</h2>
<pre><code class="lang-text">&#x76F8;&#x6BD4;&#x8F83;&#x5355;&#x5DE5;&#x7A0B;&#xFF0C;&#x591A;&#x5DE5;&#x7A0B;&#x6A21;&#x5F0F;&#x975E;&#x5E38;&#x7B80;&#x5355;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x4E0A;&#x8FF0;&#x914D;&#x7F6E;&#xFF0C;&#x4E0D;&#x8BB2;&#x89E3;&#x3002;
</code></pre>
<h2 id="&#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C;-&#x3001;&#x901A;&#x4FE1;-&#x6846;&#x67B6;"><a name="&#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C;-&#x3001;&#x901A;&#x4FE1;-&#x6846;&#x67B6;" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C;-&#x3001;&#x901A;&#x4FE1;-&#x6846;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a>1.5. &#x7EC4;&#x4EF6;&#x9875;&#x9762;&#x8DF3;&#x8F6C; &#x3001;&#x901A;&#x4FE1; &#x6846;&#x67B6;</h2>
<pre><code class="lang-text">&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x6CA1;&#x6709;&#x4F9D;&#x8D56;&#xFF0C;&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x663E;&#x793A;&#x542F;&#x52A8;&#x6765;&#x6253;&#x5F00;&#x5BF9;&#x65B9;&#x7684;Activity&#xFF0C;
&#x9690;&#x5F0F;&#x542F;&#x52A8;&#x662F;&#x53EF;&#x4EE5;&#x5B9E;&#x73B0;&#x8DF3;&#x8F6C;&#xFF0C;&#x4F46;&#x662F;&#x9690;&#x5F0F; Intent &#x9700;&#x8981;&#x901A;&#x8FC7; AndroidManifest &#x914D;&#x7F6E;&#x548C;&#x7BA1;&#x7406;&#xFF0C;&#x534F;&#x4F5C;&#x5F00;&#x53D1;&#x663E;&#x5F97;&#x6BD4;&#x8F83;&#x9EBB;&#x70E6;&#x3002;
&#x8FD9;&#x91CC;&#x4E00;&#x822C;&#x91C7;&#x7528;&#x4E1A;&#x754C;&#x901A;&#x7528;&#x7684;&#x65B9;&#x5F0F;&#x2014;&#x8DEF;&#x7531;&#x3002;

&#x4E1A;&#x754C;&#x91C7;&#x7528;&#x7684;&#x8DEF;&#x7531;&#x6846;&#x67B6;&#x6709;&#x963F;&#x91CC;&#x7684; ARouter &#x3001;&#x7F8E;&#x56E2;&#x7684; WMRouter &#x3002;
</code></pre>
<h2 id="arouter-&#x57FA;&#x672C;&#x4F7F;&#x7528;"><a name="arouter-&#x57FA;&#x672C;&#x4F7F;&#x7528;" class="anchor-navigation-ex-anchor" href="#arouter-&#x57FA;&#x672C;&#x4F7F;&#x7528;"><i class="fa fa-link" aria-hidden="true"></i></a>1.6. ARouter &#x57FA;&#x672C;&#x4F7F;&#x7528;</h2>
<p><a href="https://github.com/alibaba/ARouter/blob/master/README_CN.md" target="_blank">https://github.com/alibaba/ARouter/blob/master/README_CN.md</a></p>
<pre><code class="lang-text">1&#x3001;&#x8DEF;&#x7531;&#x8DF3;&#x8F6C;&#x662F;&#x5B50;&#x6A21;&#x5757;&#x90FD;&#x9700;&#x8981;&#x7528;&#x5230;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x5728; &#x6700;&#x57FA;&#x7840;&#x6A21;&#x5757; lib_base &#x4E2D;&#x5F15;&#x5165;&#xFF0C;
&#x5404;&#x4E2A;&#x6A21;&#x5757;&#x4F1A;&#x5F15;&#x7528;&#x8FD9;&#x4E2A;lib_base&#x3002;
compile &quot;com.alibaba:arouter-api:$rootProject.arouterVersion&quot; 

2&#x3001;&#x7136;&#x540E;&#x5728;&#x5404;&#x5B50;&#x6A21;&#x5757;&#x7684;build&#x6587;&#x4EF6;&#x4E2D;&#x5F15;&#x5165;&#xFF1A;
annotationProcessor &quot;com.alibaba:arouter-compiler:$rootProject.arouterProcessorVersion&quot;
defaultConfig {
javaCompileOptions {
    annotationProcessorOptions {
        arguments = [AROUTER_MODULE_NAME: project.getName()]
    }
 }
}

3&#x3001;&#x5982;&#x679C;&#x5DE5;&#x7A0B;&#x542F;&#x7528;&#x4E86;&#x6DF7;&#x6DC6;&#x673A;&#x5236;&#xFF0C;&#x9700;&#x8981;keep&#x76F8;&#x5173;&#x90E8;&#x5206;&#xFF0C;&#x5426;&#x5219;&#x4F1A;&#x627E;&#x4E0D;&#x5230;&#x8DEF;&#x5F84;
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider
 -keep class * implements com.alibaba.android.arouter.facade.template.IProvider

4&#x3001;&#x6CE8;&#x610F;&#x914D;&#x7F6E;&#x8DEF;&#x5F84;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5982;&#x679C;&#x662F;&#x5728;&#x4E0D;&#x540C;&#x7684;&#x6A21;&#x5757;&#x91CC;&#xFF0C;&#x7B2C;&#x4E00;&#x7EA7;&#x76EE;&#x5F55;&#x4E0D;&#x80FD;&#x76F8;&#x540C;
public static final  String BookshelfActivity=&quot;/lib_reader/BookshelfActivity&quot; ;
public static final  String EnglishListActivity=&quot;/lib_english/EnglishListActivity&quot; ;

5&#x3001;Activity &#x8DF3;&#x8F6C;
// &#x5E94;&#x7528;&#x5185;&#x7B80;&#x5355;&#x7684;&#x8DF3;&#x8F6C; 
ARouter.getInstance().build(&quot;/test/activity&quot;).navigation();

// &#x643A;&#x5E26;&#x53C2;&#x6570;&#x8DF3;&#x8F6C;
ARouter.getInstance().build(&quot;/test/1&quot;)
            .withLong(&quot;key1&quot;, 666L)
            .withString(&quot;key3&quot;, &quot;888&quot;)
            .withObject(&quot;key4&quot;, new Test(&quot;Jack&quot;, &quot;Rose&quot;))
            .navigation();
</code></pre>
<h2 id="arouter-&#x8DEF;&#x7531;&#x539F;&#x7406;"><a name="arouter-&#x8DEF;&#x7531;&#x539F;&#x7406;" class="anchor-navigation-ex-anchor" href="#arouter-&#x8DEF;&#x7531;&#x539F;&#x7406;"><i class="fa fa-link" aria-hidden="true"></i></a>1.7. ARouter &#x8DEF;&#x7531;&#x539F;&#x7406;</h2>
<pre><code class="lang-text">ARouter &#x4E3A;&#x4E86;&#x89E3;&#x8026;, &#x5728;&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x6CA1;&#x6709;&#x4F9D;&#x8D56;&#x65F6;&#x4E5F;&#x53EF;&#x4EE5;&#x5F7C;&#x6B64;&#x8DF3;&#x8F6C;&#x3002;
ARouter &#x4E2D;&#x4F7F;&#x7528;&#x4E86; javapoet &#x6CE8;&#x89E3;&#x5904;&#x7406;&#x5668;&#xFF0C;&#x751F;&#x6210;&#x989D;&#x5916;&#x7684;Java&#x6587;&#x4EF6; &#xFF0C;
 &#x5C06;&#x6CE8;&#x89E3;&#x7684;key&#x4E0E;&#x7C7B;&#x7684;&#x8DEF;&#x5F84;&#x901A;&#x8FC7;&#x4E00;&#x4E2A;Map&#x5173;&#x8054;&#x8D77;&#x6765;&#x4E86;&#xFF0C;
&#x8981;&#x6211;&#x4EEC;&#x62FF;&#x5230;&#x8FD9;&#x4E2A;Map,&#x5373;&#x53EF;&#x5728;&#x8FD0;&#x884C;&#x65F6;&#x901A;&#x8FC7;&#x6CE8;&#x89E3;&#x7684;key&#x62FF;&#x5230;&#x7C7B;&#x7684;&#x8DEF;&#x5F84; &#xFF0C;

#&#x57FA;&#x672C;&#x539F;&#x7406;&#xFF1A;
Class targetClass = Class.forName(&quot;com.xxx.xxx.xxxActivity&quot;) ;
Intent intent = new Intent(this , targetClass) ;
startActivity(intent);

# ARouter&#x4EE3;&#x7801;&#x4F53;&#x73B0;
1&#x3001;&#x52A0;&#x5165; map&#x4E2D;
public void loadInto(Map&lt;String, RouteMeta&gt; atlas) {
atlas.put(&quot;/lib_japaneese/JapneseShowActivity&quot;, RouteMeta.build(RouteType.ACTIVITY, JapneseShowActivity.class, &quot;/lib_japaneese/japneseshowactivity&quot;, &quot;lib_japaneese&quot;, null, -1, -2147483648));
}

2&#x3001;&#x4ECE; map &#x4E2D;&#x53D6;&#x51FA; class &#x751F;&#x6210; Intent ,&#x6700;&#x540E;&#x542F;&#x52A8;activity
RouteMeta routeMeta = Warehouse.routes.get(postcard.getPath());
final Intent intent = new Intent(currentContext, postcard.getDestination());
ActivityCompat.startActivityForResult((Activity) currentContext, intent, requestCode, postcard.getOptionsBundle());
ActivityCompat.startActivity(currentContext, intent, postcard.getOptionsBundle());
</code></pre>
<h2 id="arouter-&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;app&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;--&#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1;-iprovider-"><a name="arouter-&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;app&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;--&#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1;-iprovider-" class="anchor-navigation-ex-anchor" href="#arouter-&#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;app&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;--&#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1;-iprovider-"><i class="fa fa-link" aria-hidden="true"></i></a>1.8. ARouter &#x7EC4;&#x4EF6;&#x4E4B;&#x95F4;&#x901A;&#x4FE1;&#x3001;&#x7EC4;&#x4EF6;&#x548C;APP&#x4E3B;&#x6A21;&#x5757;&#x4E4B;&#x95F4;&#x901A;&#x4FE1; ( &#x901A;&#x8FC7;&#x66B4;&#x9732;&#x670D;&#x52A1; IProvider )</h2>
<pre><code class="lang-text">// &#x5B9A;&#x4E49;&#x670D;&#x52A1;
public interface ILoginProvider extends IProvider {
    boolean isLogined() ;
}

@Route(path = ProviderConfig.LoginInfoProvider, name = &quot;&#x767B;&#x5F55;&#x6570;&#x636E;&#x670D;&#x52A1;&quot;)
public class LoginInfoProvider implements ILoginProvider {
    public void init(Context context) {   }
    public boolean isLogined(){
        return true ;
    }
}

// &#x53D1;&#x73B0;&#x548C;&#x4F7F;&#x7528;&#x670D;&#x52A1;
ILoginProvider service =  (ILoginProvider) ARouter.getInstance().build(ProviderConfig.LoginInfoProvider).navigation();
boolean isLogined = service.isLogined( ) ;

// &#x4F7F;&#x7528;&#x6B65;&#x9AA4;
1&#x3001;&#x5728;&#x516C;&#x5171;&#x7684;&#x57FA;&#x7840;lib&#x4E2D;&#x5B9A;&#x4E49;&#x670D;&#x52A1;&#x63A5;&#x53E3;&#xFF0C;
2&#x3001;&#x5728;&#x5404;&#x81EA;&#x7684;lib&#x4E2D;&#x7EE7;&#x627F;&#x8FD9;&#x4E2A;&#x63A5;&#x53E3;&#x5E76;&#x5B9E;&#x73B0;&#x5177;&#x4F53;&#x529F;&#x80FD;
3&#x3001;&#x5728;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#x4E2D;&#x8C03;&#x7528;&#x63A5;&#x53E3;
</code></pre>
<h2 id="arouter-&#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;"><a name="arouter-&#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;" class="anchor-navigation-ex-anchor" href="#arouter-&#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;"><i class="fa fa-link" aria-hidden="true"></i></a>1.9. ARouter &#x9884;&#x5904;&#x7406;&#x670D;&#x52A1;</h2>
<pre><code class="lang-text">&#x8DDF;&#x9875;&#x9762;&#x62E6;&#x622A;&#x5DEE;&#x4E0D;&#x591A;&#xFF0C;&#x5C31;&#x662F;&#x5728;&#x8C03;&#x7528;&#x670D;&#x52A1;&#x4E4B;&#x524D;&#x9884;&#x5148;&#x5904;&#x7406;&#x4E00;&#x4E0B;&#x3002;
&#x6BD4;&#x5982; &#x60F3;&#x8C03;&#x7528;&#x652F;&#x4ED8;&#x6A21;&#x5757;&#x7684;&#x670D;&#x52A1;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x5148;&#x5224;&#x65AD;&#x4F60;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x767B;&#x5F55;&#xFF0C;&#x4E0D;&#x767B;&#x5F55;&#x5C31;&#x7981;&#x6B62;&#x8C03;&#x7528;
 @Route(path = RouteUtils.MyPretreatmentService)
 public class MyPretreatmentService implements PretreatmentService {
     @Override
     public boolean onPretreatment(Context context, Postcard postcard) {
         String path = postcard.getPath() ;
         if(path.equals(RouteUtils.EnglishListActivity)){
             boolean isLogined = xx ;
             if (!isLogined){
                 Toast.makeText(mcontext   , &quot;&#x8BF7;&#x5148;&#x767B;&#x5F55;&quot;, Toast.LENGTH_SHORT).show() ;
                 return  false ;
             }
         }
         return true;
     }
     private Context mcontext ;
     @Override
     public void init(Context context) {
         this.mcontext = context ;
     }
 }
</code></pre>
<h2 id="arouter-&#x9875;&#x9762;&#x62E6;&#x622A;"><a name="arouter-&#x9875;&#x9762;&#x62E6;&#x622A;" class="anchor-navigation-ex-anchor" href="#arouter-&#x9875;&#x9762;&#x62E6;&#x622A;"><i class="fa fa-link" aria-hidden="true"></i></a>1.10. ARouter &#x9875;&#x9762;&#x62E6;&#x622A;</h2>
<pre><code class="lang-text">&#x6BD4;&#x8F83;&#x7ECF;&#x5178;&#x7684;&#x5E94;&#x7528;&#x5C31;&#x662F;&#x5728;&#x8DF3;&#x8F6C;&#x8FC7;&#x7A0B;&#x4E2D;&#x5904;&#x7406;&#x767B;&#x9646;&#x4E8B;&#x4EF6;&#xFF0C;&#x8FD9;&#x6837;&#x5C31;&#x4E0D;&#x9700;&#x8981;&#x5728;&#x76EE;&#x6807;&#x9875;&#x91CD;&#x590D;&#x505A;&#x767B;&#x9646;&#x68C0;&#x67E5; &#x3002;
&#x62E6;&#x622A;&#x5668;&#x4F1A;&#x5728;&#x8DF3;&#x8F6C;&#x4E4B;&#x95F4;&#x6267;&#x884C;&#xFF0C;&#x591A;&#x4E2A;&#x62E6;&#x622A;&#x5668;&#x4F1A;&#x6309;&#x4F18;&#x5148;&#x7EA7;&#x987A;&#x5E8F;&#x4F9D;&#x6B21;&#x6267;&#x884C;&#x3002;
@Interceptor( priority = 8 , name = &quot;&#x767B;&#x5F55;&#x68C0;&#x9A8C;&#x62E6;&#x622A;&#x5668;&quot;)
public class LoginInterceptor implements IInterceptor {
    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        boolean isLogined =  false;
        callback.onContinue(postcard);
        if (isLogined) {
            callback.onContinue(postcard); //&#x4E0D;&#x62E6;&#x622A;
        } else {
            String path = postcard.getPath();
            switch (path) {
                case  RouteUtils.EnglishListActivity:
                    callback.onInterrupt( new RuntimeException(&quot;&#x8FD8;&#x672A;&#x767B;&#x5F55;&quot;)); //&#x9700;&#x8981;&#x767B;&#x9646;&#x62E6;&#x622A;
                    break;
                default:
                    callback.onContinue(postcard); //&#x4E0D;&#x62E6;&#x622A;
                    break;
            }
        }
    }

    @Override
    public void init(Context context) {
        // &#x4F1A;&#x5728;sdk&#x521D;&#x59CB;&#x5316;&#x7684;&#x65F6;&#x5019;&#x8C03;&#x7528;&#x8BE5;&#x65B9;&#x6CD5;
    }
}

ARouter.getInstance().build(RouteUtils.EnglishListActivity).navigation( context , new NavigationCallback....
// &#x5982;&#x679C;&#x88AB;&#x62E6;&#x622A;&#x5668;&#x62E6;&#x622A;&#x4E86;&#xFF0C;NavigationCallback &#x7684;&#x51FD;&#x6570; onInterrupt() &#x4F1A;&#x88AB;&#x8C03;&#x7528;...
</code></pre>
<h2 id="arouter-&#x964D;&#x7EA7;&#x7B56;&#x7565;"><a name="arouter-&#x964D;&#x7EA7;&#x7B56;&#x7565;" class="anchor-navigation-ex-anchor" href="#arouter-&#x964D;&#x7EA7;&#x7B56;&#x7565;"><i class="fa fa-link" aria-hidden="true"></i></a>1.11. ARouter &#x964D;&#x7EA7;&#x7B56;&#x7565;</h2>
<p>&#x4E00;&#x4E2A;&#x5947;&#x602A;&#x7684;&#x672F;&#x8BED;&#x3002;&#x611F;&#x89C9;&#x672F;&#x8BED;&#x540D;&#x5B57;&#x548C;&#x529F;&#x80FD;&#x4E0D;&#x662F;&#x5F88;&#x5339;&#x914D;&#x3002;</p>
<pre><code class="lang-text">&#x56E0;&#x4E3A; arouter &#x6846;&#x67B6;activity &#x8DF3;&#x8F6C;&#x662F;&#x9700;&#x8981;&#x914D;&#x7F6E;&#x8DEF;&#x7531;&#x8868;&#x7684;&#xFF0C;
&#x6240;&#x4EE5;&#x53EF;&#x80FD;&#x56E0;&#x4E3A;&#x7C97;&#x5FC3;&#x5BFC;&#x81F4;&#x8DEF;&#x7531;&#x8868;&#x914D;&#x7F6E;&#x9519;&#x8BEF;&#x7684;&#x73B0;&#x8C61;&#xFF0C;
&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#xFF0C;&#x6240;&#x4EE5;&#x641E;&#x4E86;&#x4E00;&#x4E2A; &#x6240;&#x8C13;&#x964D;&#x7EA7;&#x7B56;&#x7565;&#x6765;&#x8865;&#x6551;&#xFF0C;
&#x7ED9;&#x7528;&#x6237;&#x4E00;&#x4E2A;&#x597D;&#x4E00;&#x70B9;&#x7684;&#x4F53;&#x9A8C;&#xFF0C;&#x800C;&#x4E0D;&#x81F3;&#x4E8E;&#x70B9;&#x51FB;&#x540E;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x53CD;&#x5E94;&#x3002;
// &#x5168;&#x5C40;&#x76D1;&#x6D4B;
@Route(path = RouteUtils.MyDegradeService)
public class MyDegradeService implements DegradeService {
    @Override
    public void onLost(Context context, Postcard postcard) {
        WkLog.showLog(&quot;&#x68C0;&#x6D4B;&#x5230;&#x65E0;&#x6548;&#x8DF3;&#x8F6C;: &quot; + postcard.getPath());
    }

    @Override
    public void init(Context context) {

    }
}

// 2&#x3001;&#x72EC;&#x7ACB;&#x8DF3;&#x8F6C;
ARouter.getInstance().build(RouteUtils.EnglishListActivity).navigation( context , new NavigationCallback....
&#x5982;&#x679C;&#x8DEF;&#x7531;&#x8DEF;&#x5F84;&#x9519;&#x8BEF;&#xFF0C;NavigationCallback &#x7684; onLost() &#x4F1A;&#x88AB;&#x56DE;&#x8C03;
</code></pre>
<h2 id="arouter-&#x91CD;&#x5199;&#x8DF3;&#x8F6C;url-&#x3001;&#x91CD;&#x5B9A;&#x5411;"><a name="arouter-&#x91CD;&#x5199;&#x8DF3;&#x8F6C;url-&#x3001;&#x91CD;&#x5B9A;&#x5411;" class="anchor-navigation-ex-anchor" href="#arouter-&#x91CD;&#x5199;&#x8DF3;&#x8F6C;url-&#x3001;&#x91CD;&#x5B9A;&#x5411;"><i class="fa fa-link" aria-hidden="true"></i></a>1.12. ARouter &#x91CD;&#x5199;&#x8DF3;&#x8F6C;URL &#x3001;&#x91CD;&#x5B9A;&#x5411;</h2>
<pre><code class="lang-text">&#x5C31;&#x662F;&#x5C06;&#x4F20;&#x7ECF;&#x6765;&#x7684; &#x8DEF;&#x7531;&#x5730;&#x5740; &#x6309;&#x7167;&#x4F60;&#x7684;&#x89C4;&#x5219;&#x4FEE;&#x6539;&#x4E00;&#x4E0B;&#xFF0C;&#x518D;&#x53BB;&#x6267;&#x884C;&#xFF0C;
&#x76EE;&#x524D;&#x6211;&#x4E0D;&#x77E5;&#x9053;&#x6709;&#x54EA;&#x4E9B;&#x5E94;&#x7528;&#x573A;&#x666F;&#xFF0C;&#x5148;&#x4E0D;&#x7528;&#x3002;
PathReplaceService
</code></pre>
<footer class="page-footer"><span class="copyright">( no Copyright&#xFF0C;enjoy youself ! ) all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">The file was updated at :
2022-04-04 10:49:02
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Apk插件化开发.html" class="navigation navigation-prev " aria-label="Previous page: Apk插件化开发">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="sdk开发.html" class="navigation navigation-next " aria-label="Next page: sdk开发">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"App组件化开发","level":"1.12.27","depth":2,"next":{"title":"sdk开发","level":"1.12.28","depth":2,"path":"chinese/android基础/sdk开发.md","ref":"chinese/android基础/sdk开发.md","articles":[]},"previous":{"title":"Apk插件化开发","level":"1.12.26","depth":2,"path":"chinese/android基础/Apk插件化开发.md","ref":"chinese/android基础/Apk插件化开发.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","search-plus","todo","anchor-navigation-ex","copy-code-button","fontsettings","tbfed-pagefooter","local-video","splitter","expandable-chapters","favicon","theme-comscore","local-video"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"( no Copyright，enjoy youself ! )","modify_label":"The file was updated at :","modify_format":"YYYY-MM-DD HH:mm:ss"},"todo":{},"splitter":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"family":"sans","size":2,"theme":"white"},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"favicon":{"shortcut":"assets/images/favicon.ico","bookmark":"assets/images/favicon.ico"},"theme-comscore":{},"local-video":{},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"Aivin","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Aivin开发笔记","language":"zh-hans","gitbook":"*","description":"Aivin开发笔记"},"file":{"path":"chinese/android基础/App组件化开发.md","mtime":"2022-04-04T02:49:02.746Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-04-04T03:47:09.782Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

